package com.geekca.j2.mysingle;

/**
 * 懒汉单例模式
 */
public class LazyBoy {
    public static  LazyBoy instance;
    private LazyBoy(){}

    public static LazyBoy getInstance(){
        if (instance==null){
            System.out.println("第一次创建对象");
            instance= new LazyBoy();
        }
        return instance;
    }

}
